<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .block{
            display: block;
        }
    </style>
</head>
<body>
    <div id="app">
        {{msg}}
        <div class="load" ref="load">loading</div>
    </div>
    <script src="./vue.js"></script>
    <script>
        let vm = new Vue({
            // el:'#app',
            data:{
                msg:'hello',
                list:[]
            },
            template:'<h1>{{msg}}</h1>',
            beforeCreate() {
                console.log("beforeCreat");
                console.log(this.$el);  //undefined
                console.log(this.$data);//undefined
            },
            created() {
                console.log("create")
                console.log(this.$el);  //undefined
                console.log(this.$data) //data可以访问到
            },
            beforeMount(){
                console.log("beforeMount");
                console.log("this.$el",this.$el);
                console.log(this.$data);
                console.log(this.$refs.load)
            },
            mounted(){
                console.log("mounted");
                console.log(this.$el);
                console.log(this.$data);
                console.log(this.$refs.load)
                this.$refs.load.style.display ="none";
            },
            updated(){
                console.log('updated')
            },
            beforeUpdate() {
                console.log('beforeUpdate')
            }

        })
        vm.$mount('#app')
    </script>
</body>
</html>